#include "languageitem.h"

LanguageItem::LanguageItem(QObject *parent) :
    QObject(parent)
{
}

LanguageItem::LanguageItem(int idJezika, QString name, bool odabran, int index){
    m_IdJezika=idJezika;
    m_Name=name;
    m_Odabran=odabran;
    m_Index=index;
}

LanguageItem::~LanguageItem()
{}

QString LanguageItem::name(){
    return m_Name;
}

bool LanguageItem::odabran(){
    return m_Odabran;
}

int LanguageItem::index(){
    return m_Index;
}

int LanguageItem::idJezika(){
    return m_IdJezika;
}

void LanguageItem::setName(QString name){
    if(QString::compare(m_Name, name, Qt::CaseSensitive) != 0)
    {
        m_Name=name;
        emit dataChanged();
    }
}

void LanguageItem::setOdabran(bool odabran){
    if(m_Odabran!=odabran)
    {
        m_Odabran=odabran;
        emit dataChanged();
    }
}

void LanguageItem::setIndex(int index)
{
    if(index != m_Index)
    {
        m_Index = index;
        emit dataChanged();
    }
}

void LanguageItem::setIdJezika(int idJezika){
    if (idJezika!=m_IdJezika)
    {
        m_IdJezika=idJezika;
        emit dataChanged();
    }
}
